package com.lzh.shijicloudstack.controller;

import com.lzh.shijicloudstack.common.R;
import com.lzh.shijicloudstack.common.ResultUtil;
import com.lzh.shijicloudstack.mapper.MenuMapper;
import org.springframework.context.annotation.Profile;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 测试模块
 * 密码：123456
 * 密文：$2a$10$xqG5seRTCFNkPp6a4r5D5ei.uQG6fkcxODvEK5uZk/QJhEUPjX8gO
 *
 * @author LZH
 * @date 2023/5/12
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    private MenuMapper menuMapper;

    @PreAuthorize("hasAnyAuthority('系统管理','system:dept:list')")
    @GetMapping("/roleAdmin")
    public R<String> testRequest() {
        return ResultUtil.success("hello");
    }

    @GetMapping("/test1")
    public R<?> testBaidu() {
        return ResultUtil.success(null);
    }
}
